package cn.jingyuan.swan.cloud.mapping;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class AbstractApiResourceScanHandler implements ApiResourceScanHandler {

    protected final Logger log = LoggerFactory.getLogger(getClass());

    /** 扫描状态 */
    protected boolean scanState = true;

    /** 服务名称 */
    protected String serviceId;

    /** 项目路径 */
    protected String contextPath;

    @Override
    public boolean getScanState() {
        return scanState;
    }

    @Override
    public void enableScan() {
        scanState = true;
    }

    @Override
    public void disableScan() {
        scanState = false;
    }

    @Override
    public String getServiceId() {
        return serviceId;
    }

    @Override
    public void setServiceId(String serviceId) {
        if (null != serviceId) {
            this.serviceId = serviceId;
        }
    }

    @Override
    public String getContextPath() {
        return contextPath;
    }

    @Override
    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }

}
